package com.dong.pattern.chain;

import java.util.ArrayList;

public class ChainClient {
    public static void main(String[] args) {
        ChainHandler handlerA = new ChainHandler() {
            @Override
            protected void handleProcess() {
                System.out.println("handler a....");
            }
        };
        ChainHandler handlerB = new ChainHandler() {
            @Override
            protected void handleProcess() {
                System.out.println("handler b....");
            }
        };
        ChainHandler handlerC = new ChainHandler() {
            @Override
            protected void handleProcess() {
                System.out.println("handler c....");
            }
        };
        Chain chain = new Chain(new ArrayList<>());
        chain.addHandler(handlerA);
        chain.addHandler(handlerB);
        chain.addHandler(handlerC);

        chain.proceed();;

    }
}
